package cn.tedu.charging.device.canal;

import cn.tedu.charging.device.pojo.po.ChargingStationCanalPO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

@Slf4j
@Component
@CanalTable("charging_station")
public class StationSyncHandler implements EntryHandler<ChargingStationCanalPO> {
    @Override
    public void insert(ChargingStationCanalPO chargingStationCanalPO) {
        log.debug("同步新增充电站信息，数据:{}",chargingStationCanalPO);
        EntryHandler.super.insert(chargingStationCanalPO);
    }

    @Override
    public void update(ChargingStationCanalPO before, ChargingStationCanalPO after) {
        log.debug("同步更新充电站信息，更新前:{},更新后:{}",before,after);
        EntryHandler.super.update(before, after);
    }

    @Override
    public void delete(ChargingStationCanalPO chargingStationCanalPO) {
        log.debug("同步删除充电站信息，数据:{}",chargingStationCanalPO);
        EntryHandler.super.delete(chargingStationCanalPO);
    }
}
